var Drag = { obj : null, init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) { o.onmousedown = Drag.start; o.hmode = bSwapHorzRef ? false : true ; o.vmode = bSwapVertRef ? false : true ; o.root = oRoot && oRoot != null ? oRoot : o ; if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; o.minX = typeof minX != 'undefined' ? minX : null; o.minY = typeof minY != 'undefined' ? minY : null; o.maxX = typeof maxX != 'undefined' ? maxX : null; o.maxY = typeof maxY != 'undefined' ? maxY : null; o.xMapper = fXMapper ? fXMapper : null; o.yMapper = fYMapper ? fYMapper : null; o.root.onDragStart = new Function(); o.root.onDragEnd = new Function(); o.root.onDrag = new Function(); }, start : function(e) { var o = Drag.obj = this; e = Drag.fixE(e); var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); o.root.onDragStart(x, y); o.lastMouseX = e.clientX; o.lastMouseY = e.clientY; if (o.hmode) { if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; } else { if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; } if (o.vmode) { if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; } else { if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; } document.onmousemove = Drag.drag; document.onmouseup = Drag.end; return false; }, drag : function(e) { e = Drag.fixE(e); var o = Drag.obj; var ey = e.clientY; var ex = e.clientX; var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); var nx, ny; if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); if (o.xMapper) nx = o.xMapper(y) else if (o.yMapper) ny = o.yMapper(x) Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; Drag.obj.lastMouseX = ex; Drag.obj.lastMouseY = ey; Drag.obj.root.onDrag(nx, ny); return false; }, end : function() { document.onmousemove = null; document.onmouseup = null; Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); Drag.obj = null; }, fixE : function(e) { if (typeof e == 'undefined') e = window.event; if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; return e; } }; function divOsClass(name) { this.name = name; this.Cookie = new Cookie(); this.sajaxIO = new sajaxIO(); this.setDebug(0); this.tagTitleVisibleStyle = "active"; this.tagTitleInVisibleStyle = "inactive"; this.tagContentVisibleStyle = "showThis"; this.tagContentInVisibleStyle = "hideThis"; this.waitWord = "Please waiting..."; this.contentDivPrefix = "C"; this.TagDivPrefix = "T"; this.ResizeFix = "0"; this.tagSeq = 10; this.popSeq = 10; this.act=""; this.imagedir = "images"; this.styledir = "style"; this.hashTable = new hashUtil(); this.tagUrl = new hashUtil(); this.hashTable.put("home",0); this.TagName = "C0"; this.popHandle = new hashUtil(); this.closeTagHtml = "
"; this.Info = new Array(); this.getBrowser(); this.position=""; return this; } var tempHideDiv=""; divOsClass.prototype.AlertSuccess= 100; divOsClass.prototype.AlertFailed = 101; divOsClass.prototype.AlertWait= 102; divOsClass.prototype.AlertNote= 103; divOsClass.prototype.setInfo = function(p_word,p_info) { eval("this."+p_word+"='"+p_info+"'"); } divOsClass.prototype.refreshCloseTagHtml = function() { this.closeTagHtml = " "; } divOsClass.prototype.getBrowser = function() { var navi = window.navigator.userAgent.toUpperCase(); if (navi.indexOf("MSIE")>=1) this.browser = "IE"; else if (navi.indexOf("FIREFOX")>=1) this.browser = "FF"; return this.browser; } divOsClass.prototype.setTagDiv = function(tagname) { this.tagDivName = tagname; this.tagDiv = document.getElementById(tagname); } divOsClass.prototype.setContentDiv = function(main) { this.contentDivName = main; this.contentDiv = document.getElementById(main); } divOsClass.prototype.setDebug = function(p_debug) { if(p_debug) this._Debug = true; else this._Debug = false; } divOsClass.prototype.setTagCloseHtml = function(p_str) { this.closeTagHtml = p_str; } divOsClass.prototype.virtualOpen = function(p_url,p_name,p_target,p_icon,p_setcookie) { var tagSeq; if(p_name=='undefined' || p_name=='') return; tagSeq = this.addTag(p_name,p_icon); this.hashTable.put(p_target,tagSeq) ; this.tagUrl.put(tagSeq,p_url) ; if(typeof(p_setcookie)!="undefined" && p_setcookie) { var u=p_url.split("?"); this.Cookie.setCookie("_epage_tags",this.Cookie.getCookie("_epage_tags")+";;"+p_target+"=="+p_name+"=="+u[1]+"=="+p_icon); } } divOsClass.prototype.open = function(p_url,p_name,p_target,p_icon) { var tagSeq; if(p_target=='_blank' ) { tagSeq = this.addTag(p_name,p_icon); } else { tagSeq = this.hashTable.get(p_target); if(!this.hasTag(tagSeq) || tagSeq==null) { tagSeq = this.addTag(p_name,p_icon); var u=p_url.split("?"); this.Cookie.setCookie("_epage_tags",this.Cookie.getCookie("_epage_tags")+";;"+p_target+"=="+p_name+"=="+u[1]+"=="+p_icon); } else { this.tagUrl.remove(tagSeq); this.selectTag(tagSeq); } } this.hashTable.put(p_target,tagSeq) ; var contDiv = this.contentDivPrefix+tagSeq; this.openUrl(contDiv,p_url); } divOsClass.prototype.openUrl = function(p_div,p_url,p_silent) { if(p_url.indexOf("?")<0) p_url+="?"; else p_url+="&"; p_url+="TagName="+p_div; this.genDivContentCallBackFunction(p_div); this.sajaxIO.sajaxSubmit('','',this.name+".setdivContent"+p_div,'_displayProgram',p_url); if (!p_silent) divOs.openWaitingWindow(divOs.waitWord,"sending"); } divOsClass.prototype.openSajaxUrl = function(p_div,p_url) { if(p_url.indexOf("?")<0) p_url+="?"; else p_url+="&"; p_url+="TagName="+p_div; p_url+="&DivId="+p_div; this.sajaxIO.sajaxSubmit('','',divOsClass.prototype.DivSajaxCallBack,'sajaxSubmit',p_url); } divOsClass.prototype.openSubmitForm = function(p_title,p_url,p_form,p_param,p_style,p_event) { divid="tmp"+this.popSeq; this.openPopWindow(p_title,p_style,'',divid,p_event) ; this.submitForm('ppcont'+divid,p_url,p_form,p_param,'sajaxSubmit'); } divOsClass.prototype.submitForm = function() { a=divOsClass.prototype.submitForm.arguments; argDiv = a[0]; argUrl = a[1]; if(a[2]) argForm = a[2]; else argForm = ""; if(a[3]) argParam = a[3]; else argParam = ""; if(a[4]) argFun = a[4]; else argFun = "sajaxSubmit"; if(argUrl.indexOf("?")<0) argUrl+="?"; else argUrl+="&"; argUrl+="TagName="+argDiv; this.genDivSubmitCallBackFunction(argDiv); this.sajaxIO.sajaxSubmit(argParam,argForm,this.name+".setDivSubmitContent"+argDiv,argFun,argUrl); this.Cookie.setCookie(argDiv,argUrl); } divOsClass.prototype.DivSajaxCallBack= function(z) { var divOs_obj = eval("divOs"); if(divOs_obj._Debug) alert(z); Res= sajaxIO.prototype.getMsg(z); if(Res.DivId) $("#"+Res.DivId).html(Res.Content); if(Res.JsFunction) eval(Res.JsFunction); } divOsClass.prototype.getDivUrl = function(p_div) { var p = this.Cookie.getCookie(p_div); return p; } divOsClass.prototype.genDivContentCallBackFunction = function(p_div) { var str = "divOsClass.prototype.setdivContent"+p_div+" = function(z) {\n"; if(this._Debug) str+=" alert(z);\n"; str+= "var obj = document.getElementById('"+p_div+"');\n"; str+= "divOsClass.prototype.setInnerHTML(obj, z);\n"+ "divOs.closeWaitingWindow('sending');}"; if(this._Debug) alert(str); eval(str); } divOsClass.prototype.genDivSubmitCallBackFunction = function(p_div) { var str = "divOsClass.prototype.setDivSubmitContent"+p_div+" = function(z) {\n"; if(this._Debug) str+=" alert(z);\n"; str += "var ret = sajaxIO.prototype.getMsg(z);\n"+ "divOsClass.prototype.setInnerHTML(document.getElementById('"+p_div+"'),ret.Content);\n"+ "if(ret.JsFunction!='') eval(ret.JsFunction);\n"+ "return ret.Content;\n"+ "}\n"; if(this._Debug) alert(str); eval(str); } divOsClass.prototype.setInnerHTML = function (el, htmlCode) { if(el==null) return false; $(el).html(htmlCode); return; } divOsClass.prototype.createDiv = function(container,id,className) { if(typeof(container)=="string") containerObj = document.getElementById(container); else containerObj = container; var newDiv=document.createElement("DIV"); containerObj.appendChild(newDiv); newDiv.id=id; newDiv.className=className; } divOsClass.prototype.delDiv = function(container,id) { if(typeof(container)=="string") containerObj = document.getElementById(container); else containerObj = container; var child = document.getElementById(id); if(child==null) return false; containerObj.removeChild(child); } divOsClass.prototype.handleIEhasLayout=function(){ document.body.style.zoom = '1.1'; document.body.style.zoom = ''; } divOsClass.prototype.checkTagDivReady = function() { if(typeof(this.tagDiv)!='undefined') return true; return false; } divOsClass.prototype.addTag = function(p_name,p_icon) { var tagDivName = this.TagDivPrefix+this.tagSeq; var newLi=document.createElement("li"); newLi.id= tagDivName; newLi.className = this.tagTitleVisibleStyle ; var res = this.closeTagHtml.replace(/===TITLE===/,p_name); var icon = this.styledir+"/backstyle/back_skin_grey/icon/6.png"; if (typeof p_icon != 'undefined' && trim(p_icon)!='' && p_icon!='undefined') { icon = p_icon; } res = res.replace(/===ICON===/,icon); var str = " "; while(res!=str) { str = res; res = str.replace(/===TAG===/,this.tagSeq); } str = res; newLi.innerHTML = str; try{ this.tagDiv.appendChild(newLi); var contDivName = this.contentDivPrefix+this.tagSeq; this.createDiv(this.contentDiv,contDivName,this.tagContentVisibleStyle); this.selectTag(this.tagSeq); }catch(e) { if(this._Debug) alert(" addTag Exception \n"); this.tagDiv = document.getElementById(this.tagDivName); } return this.tagSeq++; } divOsClass.prototype.isEmptyDiv = function(p_div) { var tdiv = document.getElementById(p_div); if(tdiv==null) return false; if(tdiv.innerHTML.trim()) return false; return true; } divOsClass.prototype.hasTag = function(p_seq) { var tdiv = document.getElementById(this.TagDivPrefix+p_seq); if(tdiv==null) return false; return true; } divOsClass.prototype.delTag = function(p_seq) { this.delDiv(this.tagDiv,this.TagDivPrefix+p_seq); this.delDiv(this.contentDiv,this.contentDivPrefix+p_seq); var key = this.hashTable.getKey(p_seq); var newcookie = ""; var tags = this.Cookie.getCookie("_epage_tags").split(";;"); var tag; for(var i=0;i"+p_msg+" |
"+p_cont+"